package com.filetest;

import java.io.*;

public class ZhuanHuan {
    public static void main(String[] args) throws Exception {
        File f = new File("D:/demo4.txt");
        OutputStreamWriter os = new OutputStreamWriter(new FileOutputStream(f));
        os.write("你好 world");
        os.close();

        InputStreamReader is = new InputStreamReader(new FileInputStream(f));
        char[] c = new char[1024];
        int len = is.read(c);
        System.out.println(new String(c,0,len));
        is.close();
    }
}
